---
title: Cross Tab
description: Cross Tab Feature explanation and example
---

The cross tab feature enables reconciliation of events and state across multiple
tabs running your application. It also exposes the underlying messaging layer for
your own use. You can broadcast arbitrary messages to all tabs, regardless of
their idle state.

### Properties

The properties associated with the cross tab feature are:

{/* cspell:disable */}
- [crossTab](/docs/api/props#crosstab): Enables the cross tab feature.
- [syncTimers](/docs/api/props#synctimers): Syncs timeout durations between tabs when user activity is detected.
- [name](/docs/api/props#name): Name of the idle timer instance. Set this if you are using crossTab with multiple instances on the same page.
- [leaderElection](/docs/api/props#leaderelection): Enables the leader election feature.
- [onMessage](/docs/api/props#onprompt): Function called when a message is received.
{/* cspell:enable */}

### Methods

The methods associated with the cross tab feature are:

{/* cspell:disable */}
- [message()](/docs/api/methods#message): Broadcast a message to all tabs.
- [isLeader()](/docs/api/methods#isleader): Returns whether or not the current tab is the elected leader.
- [isLastActiveTab()](/docs/api/methods#islastactivetab): Returns whether or not the current tab is the last active tab.
- [getTabId()](/docs/api/methods#gettabid): Returns the current tab's id.
{/* cspell:enable */}

### Example
<CodeSandbox name='cross-tab-2e1tbp' />